home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 2 / Amiga Tools 2.iso / tools / packer / ha0999beta / src / machine.h < prev    next >
C/C++ Source or Header  |  1995-03-09  |  3KB  |  88 lines

  1. /***********************************************************************
  2.   This file is part of HA, a general purpose file archiver.
  3.   Copyright (C) 1995 Harri Hirvola
  4.  
  5.   This program is free software; you can redistribute it and/or modify
  6.   it under the terms of the GNU General Public License as published by
  7.   the Free Software Foundation; either version 2 of the License, or
  8.   (at your option) any later version.
  9.  
  10.   This program is distributed in the hope that it will be useful,
  11.   but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.   GNU General Public License for more details.
  14.  
  15.   You should have received a copy of the GNU General Public License
  16.   along with this program; if not, write to the Free Software
  17.   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. ************************************************************************
  19.     HA *nix specific include file
  20. ***********************************************************************/
  21.  
  22. #include <unistd.h>
  23. #include <fcntl.h>
  24. #include <sys/stat.h>
  25. #include <signal.h>
  26.  
  27. #define BETA "\337"
  28. typedef short S16B;
  29. typedef unsigned short U16B;
  30. typedef int S32B;
  31. typedef unsigned U32B;
  32.  
  33. #define EXAMPLE "\n examples : ha a21 foo /bar/* , ha l foo \"*.c\", ha xy foo" 
  34. #define ALLFILES "*"
  35. #define F_32B "d"
  36. #define FX_32B "X"
  37.  
  38. #ifndef O_BINARY
  39. #define O_BINARY 0
  40. #endif 
  41.  
  42. #define AO_FLAGS (O_RDWR)
  43. #define AO_RDOFLAGS (O_RDONLY)
  44. #define AC_FLAGS O_RDWR|O_CREAT,S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH
  45. #define DEF_FILEATTR (S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH)
  46. #define DEF_DIRATTR  (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH)
  47.  
  48. #define md_strcase(s) (s)                /* No need for this in *nix */
  49. #define md_curfilesize() filestat.st_size
  50. #define md_curfiletime() filestat.st_mtime
  51.  
  52. extern struct stat filestat;
  53.  
  54. void md_init(void);    
  55. char *md_arcname(char *name_req);
  56. void md_gethdr(int len, int mode);
  57. void md_puthdr(void);
  58. int md_newfile(void);
  59. int md_special(char *fullname, unsigned char **sdata);
  60. int md_mkspecial(char *ofname,unsigned sdlen,unsigned char *sdata);
  61. int md_filetype(char *path,char *name);
  62. void md_listhdr(void);
  63. void md_listdat(void);
  64. char *md_timestring(unsigned long t);
  65. void md_truncfile(int fh, U32B len);
  66. char *md_tohapath(char *mdpath);
  67. char *md_tomdpath(char *hapath);
  68. char *md_strippath(char *mdfullpath);
  69. char *md_stripname(char *mdfullpath);
  70. char *md_pconcat(int delim, char *head, char *tail);
  71. int md_namecmp(char *pat, char *cmp);
  72. void md_setft(char *file,U32B time);
  73. void md_setfattrs(char *file);
  74. U32B md_systime();
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.